home *** CD-ROM | disk | FTP | other *** search
/ Super PC 34 / Super PC 34 (Shareware).iso / spc / WIN / WE96 / WINEDIT.MN_ < prev    next >
Encoding:
Text File  |  1996-02-16  |  28.1 KB  |  852 lines

  1. ;WINEDIT.MNU file.
  2. ;
  3. ;Modifications courtesy of Don Lekei, Richard Merit, Morrie Wilson
  4. ; and many many others.  Thank you very much.
  5. ;
  6. ; Some functions, like version control and alternate grep commands, 
  7. ; are presented here but commented out.  If you have the corresponding
  8. ; utility, just delete the semicolons from column 1 and the function
  9. ; will be enabled.
  10. ;
  11. ;
  12. ;
  13. ; AutoExec Section is on top here.
  14. ;
  15.         TAB=@TAB
  16.         CR=@CRLF
  17.         EOL=@CR
  18.         Home=DirHome()
  19.         IntControl(29,@tab,0,0,0)  ;Standardize on tabs as delimiters for FileItemize, etc
  20.  
  21. Edit Utility Menu   ; Manage WinEdit Utility menu and help files
  22.         TheFile=strcat(DirHome(),"WINEDIT.MNU")
  23.         WFileOpen(TheFile)
  24.         Drop(TheFile)
  25. ;
  26. Edit Macro Menu   ; Manage WinEdit Macro menu
  27.         ; In the lite and standard versions of WinEdit,
  28.         ; the MACRO.ENC file is not editable.
  29.         ; In the Pro version, the file MACRO.MNU is used
  30.         ; and it can be edited.
  31.         level=2
  32.         a = FileLocate("WINEDIT.INI")
  33.         if FileExist(a) then level=IniReadPvt("WINEDIT","LEVEL","2",a)
  34.         if (level < 2) then Message("Edit Macro Menu","The Macro Menu cannot be edited in the Lite or Standard versions of WinEdit")
  35.         if (level < 2) then exit
  36.         ; else we can edit it
  37.         TheFile=strcat(DirHome(),"MACRO.MNU")
  38.         WFileOpen(TheFile)
  39.         Drop(TheFile)
  40.  
  41.  
  42. _Key Word Help      \ +{F1}         ; Load help topic for word at cursor
  43.         call("wwwedit.dll","KEYWORDHELP")
  44.  
  45. Load Help File                    ; Load a help file (no keyword lookup)
  46.         TheFile=strcat(DirHome(),"HELP\WEHELP.INI")
  47.         Keys=IniItemizePvt("HelpAll",TheFile)
  48.         KeyMax=ItemCount(Keys,@TAB)
  49.         KeyIndex=0
  50.         KeyValues=""
  51.  
  52.         :ieLoop
  53.         if KeyIndex==KeyMax then goto looped
  54.         KeyIndex=KeyIndex+1
  55.         ThisKey=ItemExtract(KeyIndex,Keys,@TAB)
  56.         if (stricmp(ThisKey,"DEFAULT")==0) then goto ieloop
  57.         ThisValue=IniReadPvt("HelpAll",ThisKey,"???",TheFile)
  58.         KeyValues=strcat(KeyValues,ThisValue,"|")
  59.         goto ieLoop
  60.         
  61.         :looped
  62.         a=ItemSelect("Select Help File",strlower(KeyValues),"|")
  63.         if a=="" then goto DONE
  64.         b = FileLocate(strcat(DirHome(),"HELP\%a%"))
  65.         if b=="" then b=FileLocate(a)
  66.         if b=="" then Message("Helpfile %a% not found","Edit %TheFile%%CR%[HelpAll] section to%CR%point to help file location%CR%or put helpfile on DOS path.")
  67.                  else WinHelp(b,"CONTENTS","")
  68.         :DONE
  69.         Drop(TheFile,Keys,KeyMax,KeyIndex,KeyValues,ThisKey,ThisValue,a,b)
  70. ;
  71.  
  72. ;
  73. _Insert Block
  74.  HTML
  75.   Template
  76.         wEdInsString("<html>")
  77.         wEdNewLine()
  78.         wEdInsString("<head>")
  79.         wEdNewLine()
  80.         wEdInsString("<title>Title</title>")
  81.         wEdNewLine()
  82.         wEdInsString("</head>")
  83.         wEdNewLine()
  84.         wEdInsString("<body>")
  85.         wEdNewLine()
  86.         wEdInsString("</body>")
  87.         wEdNewLine()
  88.         wEdInsString("</html>")
  89.         wEdNewLine()
  90.   Unordered List        
  91.         wEdInsString("<ul>")
  92.         wEdNewLine()
  93.         wEdInsString("<li>")
  94.         wEdNewLine()
  95.         wEdInsString("<li>")
  96.         wEdNewLine()
  97.         wEdInsString("<li>")
  98.         wEdNewLine()
  99.         wEdInsString("</ul>")
  100.         wEdNewLine()
  101.   Ordered List        
  102.         wEdInsString("<ol>")
  103.         wEdNewLine()
  104.         wEdInsString("<li>")
  105.         wEdNewLine()
  106.         wEdInsString("<li>")
  107.         wEdNewLine()
  108.         wEdInsString("<li>")
  109.         wEdNewLine()
  110.         wEdInsString("</ol>")
  111.         wEdNewLine()
  112.                 
  113.  If-Else
  114.      wEdNewLine()
  115.      wEdUpLine()
  116.      ; First determine if it is C or WIL
  117.      ;debug(1)
  118.      filext = FileExtension(wGetFileName())
  119.      if filext=="WBT" || filext=="WIL" || filext=="MNU" || filext=="WEB"   ; Its WIL
  120.         wEdInsString("if  xx == yy")
  121.         wEdNewLine()
  122.         wEdNewLine()
  123.         wEdInsString("else")
  124.         wEdNewLine()
  125.         wEdNewLine()
  126.         wEdInsString("endif")
  127.         wEdNewLine()
  128.         wEdUpLine()
  129.         wEdUpLine()
  130.         wEdUpLine()
  131.         wEdUpLine()
  132.      else  ;assume C
  133.         wEdInsString("if  ( xx == yy )")
  134.         wEdNewLine()
  135.         wEdInsString("   {")
  136.         wEdNewLine()
  137.         wEdNewLine()
  138.         wEdInsString("}")
  139.         wEdNewLine()
  140.         wEdLeft()
  141.         wEdLeft()
  142.         wEdLeft()
  143.         wEdInsString("else")
  144.         wEdNewLine()
  145.         wEdInsString("   {")
  146.         wEdNewLine()
  147.         wEdNewLine()
  148.         wEdInsString("}")
  149.         wEdNewLine()
  150.         wEdUpLine()
  151.         wEdUpLine()
  152.         wEdUpLine()
  153.         wEdUpLine()
  154.         wEdUpLine()
  155.         wEdUpLine()
  156.      endif
  157.      drop(s,filext)
  158.  Switch
  159.      wEdNewLine()
  160.      wEdUpLine()
  161.      filext = FileExtension(wGetFileName())
  162.      if filext=="WBT" || filext=="WIL" || filext=="MNU" || filext=="WEB"   ; Its WIL
  163.         wEdNewLine()
  164.         wEdUpLine()
  165.         wEdInsString("switch switchvar")
  166.         wEdNewLine()
  167.         wEdInsString("   case 1")
  168.         wEdNewLine()
  169.         wEdInsString("   break")
  170.         wEdNewLine()
  171.         wEdNewLine()
  172.         wEdLeft()
  173.         wEdLeft()
  174.         wEdLeft()
  175.         wEdInsString("case 2")
  176.         wEdNewLine()
  177.         wEdInsString("   break")
  178.         wEdNewLine()
  179.         wEdNewLine()
  180.         wEdLeft()
  181.         wEdLeft()
  182.         wEdLeft()
  183.         wEdInsString("case 3")
  184.         wEdNewLine()
  185.         wEdInsString("   break")
  186.         wEdNewLine()
  187.         wEdNewLine()
  188.         wEdLeft()
  189.         wEdLeft()
  190.         wEdLeft()
  191.         wEdLeft()
  192.         wEdLeft()
  193.         wEdLeft()
  194.         wEdInsString("endswitch")
  195.         wEdNewLine()
  196.         wEdUpLine()
  197.         wEdUpLine()
  198.         wEdUpLine()
  199.         wEdUpLine()
  200.         wEdUpLine()
  201.         wEdUpLine()
  202.         wEdUpLine()
  203.         wEdUpLine()
  204.         wEdUpLine()
  205.      else  ;assume C
  206.         wEdInsString("switch (swvar)")
  207.         wEdNewLine()
  208.         wEdInsString("   {")
  209.         wEdNewLine()
  210.         wEdInsString("case 1:")
  211.         wEdNewLine()
  212.         wEdInsString("   break;")
  213.         wEdNewLine()
  214.         wEdNewLine()
  215.         wEdLeft()
  216.         wEdLeft()
  217.         wEdLeft()
  218.         wEdInsString("case 2:")
  219.         wEdNewLine()
  220.         wEdInsString("   break;")
  221.         wEdNewLine()
  222.         wEdNewLine()
  223.         wEdLeft()
  224.         wEdLeft()
  225.         wEdLeft()
  226.         wEdInsString("case 3:")
  227.         wEdNewLine()
  228.         wEdInsString("   break;")
  229.         wEdNewLine()
  230.         wEdNewLine()
  231.         wEdLeft()
  232.         wEdLeft()
  233.         wEdLeft()
  234.         wEdLeft()
  235.         wEdLeft()
  236.         wEdLeft()
  237.         wEdInsString("   }")
  238.         wEdNewLine()
  239.         wEdUpLine()
  240.         wEdUpLine()
  241.         wEdUpLine()
  242.         wEdUpLine()
  243.         wEdUpLine()
  244.         wEdUpLine()
  245.         wEdUpLine()
  246.         wEdUpLine()
  247.         wEdUpLine()
  248.      endif
  249.      drop(s,filext)
  250.  While
  251.      wEdNewLine()
  252.      wEdUpLine()
  253.      filext = FileExtension(wGetFileName())
  254.      if filext=="WBT" || filext=="WIL" || filext=="MNU"  || filext=="WEB"  ; Its WIL
  255.         wEdInsString("while xx == yy")
  256.         wEdNewLine()
  257.         wEdNewLine()
  258.         wEdInsString("endwhile")
  259.         wEdNewLine()
  260.         wEdUpLine()
  261.         wEdUpLine()
  262.      else  ;assume C
  263.         wEdInsString("while (xx == yy)")
  264.         wEdNewLine()
  265.         wEdInsString("   {")
  266.         wEdNewLine()
  267.         wEdNewLine()
  268.         wEdInsString("}")
  269.         wEdNewLine()
  270.         wEdUpLine()
  271.         wEdUpLine()
  272.      endif
  273.      drop(s,filext)
  274.  Comment block       \ +^B
  275.         filext = FileExtension(wGetFileName())
  276.         if filext=="WBT" || filext=="WIL" || filext=="MNU" || filext=="WEB"  then cmt=";" ; Its WIL
  277.               else cmt="//"
  278.         s=""
  279.         ;if wGetSelState() then
  280.         s=wEdGetWord()
  281.         clipput ("%cmt%***************************************************************************%CR%")
  282.         clipappend("%cmt%** %s%%CR%")
  283.         clipappend("%cmt%** %CR%")
  284.         clipappend("%cmt%** %CR%")
  285.         clipappend ("%cmt%***************************************************************************%CR%")
  286.         wEDgotocol(1) ;insert above current line
  287.         wedstartsel()
  288.         wedendsel()
  289.         wednewline()
  290.         wEDgotocol(1) ;insert above current line
  291.         Wedpaste()
  292.         weddownline()
  293.         weddownline()
  294.         wedend()
  295.         drop(s,filext,cmt)
  296. ;
  297. ;Builds a DETAILED comment block from the label under the cursor.
  298. ;
  299.  Comment SUPER block       \ ^!B
  300.         filext = FileExtension(wGetFileName())
  301.         if filext=="WBT" || filext=="WIL" || filext=="MNU" || filext=="WEB"  then cmt=";" ; Its WIL
  302.               else cmt="//"
  303.         s=""
  304.         ;if wGetSelState() then
  305.         s=wEdGetWord()
  306.         clipput ("%cmt%***************************************************************************%CR%")
  307.         clipappend("%cmt%** %s%%CR%")
  308.         clipappend("%cmt%** %CR%")
  309.         clipappend("%cmt%** %CR%")
  310.         clipappend("%cmt%** Inputs: %CR%")
  311.         clipappend("%cmt%** Outputs: %CR%")
  312.         clipappend("%cmt%** Preserves: %CR%")
  313.         clipappend("%cmt%** Corrupts: %CR%")
  314.         clipappend ("%cmt%***************************************************************************%CR%")
  315.         wEDgotocol(1) ;insert above current line
  316.         wedstartsel()
  317.         wedendsel()
  318.         wednewline()
  319.         wEDgotocol(1) ;insert above current line
  320.         Wedpaste()
  321.         weddownline()
  322.         weddownline()
  323.         wedend()
  324.         drop(s,filext,cmt)
  325. ;
  326. ;Merge File header comment file from disk
  327. ;
  328. ;Header Block    \ ^!H
  329. ;        Wedgotoline(1)
  330. ;        WedGotoCol(1)
  331. ;        wFileMerge("header")
  332.  
  333. ;
  334. ;Shells external process to produce fancy printout of a file
  335. ;         
  336. ;Hardcopy        \ ^H
  337. ;        n=wGetfilename()
  338. ;        cmd="-o=10 -l,l %n% > lpt1"
  339. ;        AskLine("Hardcopy","Enter hardcopy command:",cmd)
  340. ;        wRunCommand("DOSPRMPT.PIF /c hcopy %cmd%",@FALSE,@FALSE)
  341. ;        drop (n,cmd)
  342.  
  343. ;
  344. ;
  345. Language Support
  346.  Generate C Tags                   ; Index source files
  347.         ; uses the TAGS.EXE program to generate WINEDIT.MRK file
  348.         ; that the next function uses to look up function names
  349.         ; in your source
  350.         RunWait("TAGS.EXE","-om -tWINEDIT.MRK *.c")
  351.         Message("Tags","Processing complete")
  352.  
  353.  Go to tag                         ; Jump to function definition
  354.         ; looks up the current word in WINEDIT.MRK, loads the file,
  355.         ; and moves the cursor to the correct line
  356.         ;DEBUG(1)
  357.         goto START
  358.         :GETWORD
  359.         a = AskLine("Go to tag", "Enter function definition to jump to:", "")
  360.         strupper(a)
  361.         len = strlen(a)
  362.         if len==0 then goto NOWORD
  363.         goto START2
  364.         :START
  365.         a=WEdGetWord()
  366.         strupper(a)
  367.         len = strlen(a)
  368.         if len==0 then goto GETWORD
  369.         :START2
  370.         b=FileLocate("winedit.mrk")
  371.         WFileOpen(b)
  372.         WFind(a,@TRUE,@FALSE)
  373.         WEdHome()
  374.         WEdStartSel()
  375.         WEdEnd()
  376.         WEdEndSel()
  377.         WEdCopy()
  378.         WWinClose()
  379.         line=ClipGet()
  380.         line2=strupper(line)
  381.         c=StrIndex(line2,a,0,@FWDSCAN)
  382.         d=StrIndex(line2," ",c,@FWDSCAN)
  383.         e=StrIndex(line2,"(",d,@FWDSCAN)
  384.         filename=StrSub(line2,d,e-d)
  385.         lineno=StrSub(line2,e+1,strlen(line2)-e-1)
  386.         WFileOpen(filename)
  387.         WEdGoToLine(lineno)
  388.         WEdHome()
  389.         Drop(len,b,line,line2,c,d,e,filename,lineno)
  390.         :NOWORD
  391.         Drop(a)
  392. ;
  393.  
  394.  Grep    \      ^G             ; Run fgrep
  395.         a = "fgrep.com"
  396.         b = FileLocate(strcat(DirHome(),a))
  397.         if b=="" then b=FileLocate(a)
  398.         if b=="" then Message("Error","Fgrep utility not found.  You can download fgrep.com from our Web site http://www.windowware.com/wwwftp/wilson/fgrep.zip")
  399.                  then goto DONE
  400.         GrepWord = wEdGetWord()         ; Get Selected word if any
  401.         command = AskLine("Grep","Enter the grep commmand to run:","tee.com %b% -M %GrepWord% *.c")
  402.         wRunCommand(command,@TRUE,@TRUE)
  403.         :DONE
  404.         Drop(command,GrepWord,a,b);
  405.  
  406.  
  407. ;Multifile grep command. Expects to find unix-compatable grep AND gres
  408. ;commands in the path!  It parses the result into an error file so that 
  409. ;next and previous error works 
  410. ;
  411.  
  412. ; Grep    \      ^G             ; Run fgrep
  413. ;        Tee=strcat(DirHome(),"tee.com")
  414. ;        Where=strlower(StrSub(dirget(),1,strlen(dirget())-1))
  415. ;        drv=StrSub(Where,1,2)
  416. ;        ext=strlower(fileExtension(wGetFilename()))
  417. ;        if (ext=="c"|ext=="h") then ext = "?"
  418. ;        GrepWord = wEdGetWord()         ; Get Selected word if any
  419. ;        command = GrepWord
  420. ;        command = AskLine("Grep (multifile)","Drive:  %drv%   Dir:  %Where% %CR% %CR%Enter text to find: ","%GrepWord%")
  421. ;        wRunCommand("grep -n %command% %Where%\*.%ext%|gres '^(..[^:]*)(: )([0-9][0-9]*)(: )' '\1 \3 Error:'",@TRUE,@TRUE)
  422. ;        Drop(command,GrepWord,Tee,Where,drv)
  423. ;
  424.  
  425.  
  426. Convert line endings
  427.  Strip carrage returns (Unixize the file)
  428.         fn = wGetFileName()
  429.         fs=Filesize(fn)
  430.         bb=BinaryAlloc(fs)
  431.         BinaryRead(bb,fn)
  432.         oldname=strcat(FilePath(fn),FileRoot(fn),".BAK")
  433.         wWinClose ()
  434.         Mac=BinaryStrCnt(bb,0,fs-1,@LF)
  435.         If Mac==0
  436.            message ("No Linefeeds","This file can't be safely stripped")
  437.            wFileOpen(fn)
  438.            binaryfree(bb)
  439.            exit
  440.         endif
  441.         FileMove(fn,oldname,0) ; Make backup   
  442.         if binarypeek(bb,0)==13 then binarypokestr(bb,0," ")
  443.         q=0
  444.         while 1
  445.             q=BinaryIndex(bb,q,@CR,@fwdscan)
  446.             if q==0 then break
  447.             BinaryPokeStr(bb,q," ")
  448.         endwhile
  449.         BinaryWrite(bb,fn)
  450.         BinaryFree(bb)
  451.         wFileOpen(fn)
  452.  
  453.   
  454.  Replace LF with CR/LF  (DOSize the file)
  455.         ;if isdefined(dest)
  456.         ;  if dest<>0 then binaryfree(dest)
  457.         ;endif
  458.         ;if isdefined(source)
  459.         ;  if source<>0 then binaryfree(source)
  460.         ;endif
  461.         fn = wGetFileName()
  462.         fs=Filesize(fn)+1
  463.         source=BinaryAlloc(fs)
  464.         BinaryRead(source,fn)
  465.         BinaryPoke(source,fs-1,10)
  466.         DestSize= fs+BinaryStrCnt(source,0,fs-1,@LF)-1
  467.         dest=BinaryAlloc(DestSize+1)
  468.         oldname=strcat(filepath(fn),FileRoot(fn),".BAK")
  469.         wWinClose ()
  470.         Smark=0
  471.         Dmark=0
  472.         while 1
  473.            offset=BinaryIndex(source,Smark,@LF,@fwdscan)
  474.            if offset==0 then break
  475.            length=offset-Smark
  476.            BinaryCopy(dest,Dmark,source,Smark,length)
  477.            Smark=Smark+length+1
  478.            if BinaryPeek(source,offset-1)==13  then length=length-1
  479.            BinaryPokestr(dest,Dmark+length,@CRLF)
  480.            Dmark=Dmark+length+2
  481.         endwhile
  482.         filemove(fn,oldname,0)
  483.         BinaryWrite(dest,fn)
  484.         dest=binaryfree(dest)
  485.         source=BinaryFree(source)
  486.         wFileOpen(fn)
  487.  
  488. ;
  489. ;        
  490. ;Delete to end of word. A real, proper, sane one. Like the good old days!
  491. ;If the cursor is in/before text, the rest of the word will be deleted.
  492. ;If the cursor is in whitespace, the rest of the whitespace will be deleted
  493. ;If the cursor is at the end of line, the next line will be concatinated
  494. ;
  495. ;
  496. Delete to end of word   \ ^T
  497.         col = wgetcolno()             ;save current posn
  498.         wedend()
  499.         e = wgetcolno()               ;Find end of line
  500.         if col>=e then goto Dend      ;end of line -- do delete! (concat lines)
  501.         wedgotocol(col)               ;back where we started
  502.         c1=wgetchar()
  503.         wEdStartSel()
  504.         :loop
  505.         wedright()
  506.         if wgetcolno() < e then c=wgetchar()
  507.         else c=""
  508.         if !strcmp(c1," ") then if !strcmp(c," ") then goto loop
  509.         if strcmp(c1," ") then if strlen(c) then if strcmp(c,"!")>=0 then if ((strcmp(c,":")<0) || (strcmp(c,"?")>0)) then goto loop
  510.         wEdEndSel()
  511.         :Dend
  512.         wEdDelete()
  513.         drop(c)
  514. ;
  515.  
  516. ;Improved toggle-case macro for Winedit 3.1
  517. ;
  518.  
  519. Toggle case     \ ^Q
  520.         a = wGetSelState()
  521.         if a == 1 then goto selection
  522.         a = wGetChar()
  523.         if (a == StrLower(a)) then a = StrUpper(a)
  524.         else a = StrLower(a)
  525.         wEdDelete()
  526.         wEdInsString(a)
  527.         Drop(a)
  528.         exit
  529.         :selection
  530.         line = wGetLineNo()
  531.         col = wGetColNo()
  532.         wEdCut()
  533.         a=clipget()
  534.         if (a == StrLower(a)) then ClipPut(StrUpper(a))        
  535.         else ClipPut(StrLower(a))        
  536.         wEdPaste()
  537.         wEdStartSel()
  538.         wEdGotoLine(line)
  539.         wEdGotoCol(col)
  540.         wEdEndSel()
  541.         drop (a,line,col)
  542.         
  543. ; Open the file under the cursor or marked
  544. ;
  545. Open highlighted file    \ ^F       ; Open selected file
  546.         name = wEdGetWord()
  547.         length = strlen(name)
  548.         if length==0 then goto DONE
  549.         b = FileLocate(name)
  550.         if b == "" then Message("Open selected file","Cannot find %name%")
  551.         if b == "" then goto DONE
  552.         wFileOpen(b)
  553.         :DONE
  554.         drop(name,length,b)
  555. ;
  556.         
  557. ;
  558. ;Version Control for use with RCS
  559. ;
  560. ;&Version Control           ; RCS commands
  561. ;; Lock/get file (co -l)  \ ^!F
  562. ;;        opt2="-l"
  563. ;;        goto lgf2
  564. ; Get file (co)          \ ^!O  
  565. ;        opt2=""
  566. ;        :lgf2
  567. ;        Where=StrSub(dirget(),1,strlen(dirget())-1)
  568. ;        drv=StrSub(Where,1,2)
  569. ;        b=wGetFileName()
  570. ;        if b==1 then b=""
  571. ;        if wGetSelState() then s=wEdGetWord()
  572. ;           else s=b
  573. ;        a = AskLine("RCS Checkout %opt2%", "Drive:  %drv%   Dir:  %Where% %CR% %CR%Enter file you want to lock:", s)
  574. ;        ParseData(a)
  575. ;        s=fileroot(param%param0%)
  576. ;        if s==fileroot(b) then wWinClose()
  577. ;           else if b!="" then if AskYesNo("%a% is not the active file.%CR% %CR%Close Files","Close all files before continuing?")==@YES then wWinCloseall()
  578. ;
  579. ;;OS/2 Version
  580. ;;        wRunCommand("%drv% |cd %Where%|wetee co %opt2% %a%",@FALSE,@TRUE)
  581. ;;        pause("OS/2 Bug","Tell the stupid OS/2 when the program is done!")
  582. ;;DOS/WIN Version
  583. ;        wRunCommand("%drv% |cd %Where%|wetee co %opt2% %a%",@TRUE,@TRUE)
  584. ;      
  585. ;         Wfileopen(b)
  586. ;        b=FileLocate(a)
  587. ;        if b=="" then goto NotFound
  588. ;          WFileOpen(b)
  589. ;          goto DONE
  590. ;        :NotFound
  591. ;          Message("Sorry", "%a% not found...")
  592. ;          goto Done
  593. ;        :DONE
  594. ;        Drop(a)
  595. ;        Drop(b,Where,drv,s)
  596. ;
  597. ; Checkin file (ci)     \ ^!I
  598. ;        Where=StrSub(dirget(),1,strlen(dirget())-1)
  599. ;        drv=StrSub(Where,1,2)
  600. ;        b=wGetFileName()
  601. ;        if b==1 then b=""
  602. ;        if wGetSelState() then s=wEdGetWord()
  603. ;           else s=b
  604. ;        a = AskLine("RCS Checkin (unlock)", "Drive:  %drv%   Dir:  %Where% %CR% %CR%Enter file you want to put back:",s )
  605. ;        ParseData(a)
  606. ;        s=fileroot(param%param0%)
  607. ;        if s==fileroot(b) then wWinClose() 
  608. ;           else if AskYesNo("%a% is not the active file.%CR% %CR%Close Files","Close all files before continuing?")==@YES then wWinCloseall()
  609. ;        wRunCommand("%drv% |cd %Where%|wetee ci %a%",@TRUE,@TRUE)
  610. ;;(if OS/2)     pause("OS/2 Bug","Tell the stupid OS/2 when the program is done!")
  611. ;        wfileopen(b) ; reopen original window
  612. ;        Drop(a,Where,drv,b,s)
  613. ;
  614. ; Enter any command (clean)     \ ^!C
  615. ;        Where=StrSub(dirget(),1,strlen(dirget())-1)
  616. ;        drv=StrSub(Where,1,2)
  617. ;        b=wGetFileName()
  618. ;        if b==1 then b=""
  619. ;        if wGetSelState() then s=wEdGetWord()
  620. ;           else s=strcat("rcsclean ",b)
  621. ;        a = AskLine("Any Command", "Drive:  %drv%   Dir:  %Where% %CR% %CR%Enter command:", s)
  622. ;        ParseData(a)
  623. ;        s=fileroot(param%param0%)
  624. ;        if s==fileroot(b) then wWinClose()
  625. ;           else if AskYesNo("Close Files","%S% is not the active file.%CR% %CR%Close all files before continuing?")==@YES then wWinCloseall()
  626. ;        wRunCommand("%drv% |cd %Where%|%a%",@TRUE,@TRUE)
  627. ;;if OS/2        pause("OS/2 Bug","Tell the stupid OS/2 when the program is done!")
  628. ;        wfileopen(b)
  629. ;        Drop(a,b,s,Where,drv)
  630. ;
  631. ;; &Logfile Info (locked)
  632. ;;        a = AskLine("PVCS Logfile Command", "Drive:  %drv%   Dir:  %Where% %CR% %CR%Enter file for which you want logfile info:", "")
  633. ;;        a=strcat("tee vlog -BL ",a)
  634. ;;        wRunCommand(a,@TRUE,@TRUE)
  635. ;;        Drop(a,Where,drv)
  636. ;
  637. ;; &Update all source files
  638. ;;        wRunCommand("tee get -u *.??v",@TRUE,@TRUE)
  639. ;
  640. ;
  641. ;&Version Control          ; PVCS commands
  642. ; &Get a file (w/lock)
  643. ;        a = AskLine("PVCS Get (w/lock) Command", "Enter file you want to lock:", "")
  644. ;        b=strcat("tee get -L ",a)
  645. ;        wRunCommand(b,@TRUE,@TRUE)
  646. ;        Drop(b)
  647. ;        b=FileLocate(a)
  648. ;        if b=="" then goto NotFound
  649. ;          WFileOpen(b)
  650. ;          goto DONE
  651. ;        :NotFound
  652. ;          Message("???", "%a% not found...")
  653. ;          goto Done
  654. ;        :DONE
  655. ;        Drop(a)
  656. ;        Drop(b)
  657. ;
  658. ; &Put a file back (unlock)
  659. ;        a = AskLine("PVCS Put (unlock) Command", "Enter file you want to put back:", "")
  660. ;        a=strcat("tee put ",a)
  661. ;        wRunCommand(a,@TRUE,@TRUE)
  662. ;        Drop(a)
  663. ;
  664. ; &Enter any PVCS command
  665. ;        a = AskLine("PVCS Command", "Enter PVCS command:", "")
  666. ;        a=strcat("tee ",a)
  667. ;        wRunCommand(a,@TRUE,@TRUE)
  668. ;        Drop(a)
  669. ;
  670. ; &Logfile Info (locked)
  671. ;        a = AskLine("PVCS Logfile Command", "Enter file for which you want logfile info:", "")
  672. ;        a=strcat("tee vlog -BL ",a)
  673. ;        wRunCommand(a,@TRUE,@TRUE)
  674. ;        Drop(a)
  675. ;
  676. ; &Update all source files
  677. ;        wRunCommand("tee get -u *.??v",@TRUE,@TRUE)
  678. ;
  679. ;;
  680.  
  681. _Utilities      ;      Select from list of utilities
  682.  &Freespace on Local Drives   ; Display free disk space on drives
  683.  
  684.         Drive=DiskScan(2)     ; 2 is the code for local hard drives
  685.         Dmax=strlen(Drive)
  686.         DIndex=1
  687.         TotalSize=0
  688.         DriveReport=""
  689.  
  690.         :COUNTSPACE
  691.         NextDrive=StrSub(Drive,Dindex,1)
  692.         a=DiskFree(NextDrive)/1024
  693.         TotalSize=a+TotalSize
  694.         DriveReport=strcat(DriveReport,NextDrive," = ",a,"K","@")
  695.         DIndex=Dindex+3  ;each entry is 3 bytes long
  696.         if DIndex<=Dmax then goto COUNTSPACE
  697.         ItemSelect("Total Space Available = %TotalSize%K",DriveReport,"@")
  698.         Drop(xxx,TotalSize,DriveReport,NextDrive,LastDrive)
  699.  
  700.  &Wallpaper                   ; Change the desktop wallpaper
  701.            DirChange(dirWindows(0))
  702.            a=FileItemize("*.BMP")
  703.            a=strcat("-None- ",a)
  704.            a=ItemSelect("Select New Wallpaper",a,@tab)
  705.            terminate(a=="","Wallpaper","No wallpaper selected")
  706.            if a=="-None-" then Wallpaper("",0)
  707.            if a=="-None-" then exit
  708.            tile=@FALSE
  709.            if FileSize(a)<40000 then tile=@TRUE  
  710.            ;if bmp size less than 40K, assume tile, else center
  711.            Wallpaper(a,tile)
  712.            drop(a,b,tile)
  713.         exit
  714.  
  715.  Paste Special Characters             ; Paste high ASCII characters to clipboard or document
  716.   Copy &FormFeed to Clipboard
  717.        Clipput(Num2char(12))
  718.   Copy &Special Characters to Document
  719.        a=" í| ó| ú| ñ| Ñ| ª| º| ¿| ⌐| ¬|"       ;161 thru 170
  720.        b=" ½| ¼| ¡| «| »| ░| ▒| ▓| │| ┤|"       ;171 thru 180
  721.        c=" ╡| ╢| ╖| ╕| ╣| ║| ╗| ╝| ╜| ╛|"       ;181 thru 190
  722.        d=" ┐| └| ┴| ┬| ├| ─| ┼| ╞| ╟| ╚|"       ;191 thru 200
  723.        e=" ╔| ╩| ╦| ╠| ═| ╬| ╧| ╨| ╤| ╥|"       ;201 thru 210
  724.        f=" ╙| ╘| ╒| ╓| ╫| ╪| ┘| ┌| █| ▄|"       ;211 thru 220
  725.        g=" ▌| ▐| ▀| α| ß| Γ| π| Σ| σ| µ|"       ;221 thru 230
  726.        h=" τ| Φ| Θ| Ω| δ| ∞| φ| ε| ∩| ≡|"       ;231 thru 240
  727.        i=" ±| ≥| ≤| ⌠| ⌡| ÷| ≈| °| ∙| ·|"       ;241 thru 250
  728.        j=" √| ⁿ| ²| ■|  "                       ;251 thru 255
  729.        a=strcat(a,b,c,d,e,f,g,h,i,j)
  730.        Drop(b,c,d,e,f,g,h,i,j)
  731.        a=ItemSelect("Choose a character",a,"|")
  732.        a=strsub(a,2,1)
  733.        wEdInsString(a)
  734.        Drop(a)
  735.  
  736.  
  737. &System Information
  738.        wintype="retail"
  739.        if WinMetrics(22) then wintype="debug"
  740.         wcx=WinMetrics(-3)
  741.         math="Math"
  742.         switch wcx
  743.            case 0   ; Win16
  744.                 wc=WinConfig()
  745.                 if !(wc&1) then mode="Real"
  746.                 if wc&16 then mode="Standard"
  747.                 if wc&32 then mode="Enhanced"
  748.                 
  749.                 if wc&64 then cpu=8086
  750.                 if wc&128 then cpu=80186
  751.                 if wc&2 then cpu=286
  752.                 if wc&4 then cpu=386
  753.                 if wc&8 then cpu=486
  754.                 mode = strcat(mode,' ',wintype,' Windows ')
  755.                 if !(wc&1024)  then math="No math"
  756.                 break
  757.           case 1 ; Win32 Intel
  758.                mode="Intel 32-bit %wintype% Windows "
  759.                cpu= ItemExtract(6,WinSysInfo(),@tab)
  760.                break
  761.           case 2 ; Dec Alpha
  762.                mode="DEC Alpha %wintype% Windows NT "
  763.                cpu= ItemExtract(6,WinSysInfo(),@tab)
  764.                break
  765.           case 3 ; MIPS
  766.                mode="MIPS %wintype% Windows NT "
  767.                cpu= ItemExtract(6,WinSysInfo(),@tab)
  768.                break
  769.           case 4 ; PowerPC 
  770.                mode="PowerPC %wintype% Windows NT "
  771.                cpu= ItemExtract(6,WinSysInfo(),@tab)
  772.                break
  773.           case wcx
  774.                cpu= ItemExtract(6,WinSysInfo(),@tab)
  775.                mode="Unknown platform %wintype% Windows  "
  776.         endswitch
  777.  
  778.         Sysinfo=strcat(cpu,' ',mode,WinVersion(1),'.',WinVersion(0),@CRLF)
  779.  
  780.         mouse="No Mouse"
  781.         if WinMetrics(19) then mouse="Mouse"
  782.  
  783.         Sysinfo=strcat(sysinfo,math," co-processor.   ",mouse,' available.',@CRLF)
  784.  
  785.         sysinfo=strcat(sysinfo,WinMetrics(0),'x',WinMetrics(1)," video resolution.  ",WinMetrics(-1),"  colors.",@CRLF)
  786.  
  787.         ErrorMode(@OFF)
  788.         LastError()
  789.         PlayMedia("Status WaveForm Ready")
  790.         ErrorMode(@CANCEL)
  791.         if LastError()!=1193 then sysinfo=strcat(sysinfo,"Windows multimedia extensions present.",@CRLF)
  792.         a=NetInfo(0)
  793.         if a=="MULTINET"
  794.              b=NetInfo(1)
  795.              bug=strcat(b,"network(s) installed")
  796.              ;Message("Multinet supporting  %count% networks", b)
  797.         else
  798.              ;Message("Installed Network", a)
  799.              bug=strcat(a," network installed")
  800.         endif
  801.         sysinfo=strcat(sysinfo,bug,@crlf)
  802.  
  803.  
  804.         switch wcx
  805.            case 0
  806.                bug=WinResources(0)/1024   ; Compute memory avail
  807.                math=strlen(bug)
  808.                if math>3 then bug=strcat(strsub(bug,1,math-3),',',strsub(bug,math-2,3))
  809.                sysinfo=strcat(sysinfo,CR,bug," KB Free Memory",CR)
  810.                sysinfo=strcat(sysinfo,WinResources(2),"%% System Resources Free (",WinResources(3),"%% GDI, ",WinResources(4),"%% User)",CR)
  811.               break
  812.            case wcx
  813.               bug=WinResources(11)/1024   ; Get Physical memory avail
  814.               sysinfo=strcat(sysinfo,CR,bug," KB Physical Memory",CR)
  815.               bug=(WinResources(14)/1024)+bug   ; Get Virtual memory + Physical avail
  816.               sysinfo=strcat(sysinfo,bug," KB Total Memory",CR)
  817.         end switch
  818.  
  819.  
  820.         sysinfo=strcat(sysinfo,"Console ",DosVersion(1),'.',DosVersion(0),"  using ",environment("COMSPEC"),@CRLF)
  821.         disks=DiskScan(1)
  822.         disks=StrReplace(disks,@tab," ")
  823.         if disks!="" then sysinfo=strcat(sysinfo,"Floppies ",disks,@CRLF)
  824.         disks=DiskScan(2)
  825.         disks=StrReplace(disks,@tab," ")
  826.         if disks!="" then sysinfo=strcat(sysinfo,"Hard Disks ",disks,@CRLF)
  827.         disks=DiskScan(4)
  828.         disks=StrReplace(disks,@tab," ")
  829.         if disks!="" then sysinfo=strcat(sysinfo,"Network Disks ",disks,@CRLF)
  830.         sysinfo=strcat(sysinfo,"Windows Directory ",DirWindows(0),@CRLF)
  831.         sysinfo=strcat(sysinfo,"System  Directory ",DirWindows(1),@CRLF)
  832.         sysinfo=strcat(sysinfo,@CRLF,"WIL Interpreter Ver ",VersionDll())
  833.  
  834.         ver=Version()
  835.         Message("%Param2% %ver% SysInfo",Sysinfo)
  836.         Exit
  837.  
  838. Interactive Execution
  839.           if !IsDefined(uyit65) then uyit65="Message( , )"
  840.           :NEXT
  841.           uyit65=AskLine("Interactive Execution","Enter Command",uyit65)
  842.           execute %uyit65%
  843.           goto NEXT
  844.           
  845. _Run a WIL Script File
  846.          if wGetModified()==@TRUE then wFileSave()
  847.          TheFile = WGetFileName()
  848.          Call(TheFile,"")
  849.  
  850.         
  851.